extends ../../common/layout

block links
    link(rel='stylesheet', href='/css/pages/book/info.css')
block header
    header= book.name
        a(href=`${toBack?'javascript:history.back();':'/book'}` class="pol")
            icon(class="iconfont icon-Toright")
        a(href="/book" class="por")
            icon(class="iconfont icon-books")
block content
    div(class="book-info clearfix")
        div(class="fl")
            div(class="book-img")
                img( src=`${imgUrlConfig + book.id}`)
        div(class="book-box")
            span(class="book-name")= book.name
            span
                i(class="book-title") 作者：
                = book.author
            span
                i(class="book-title") 类型：
                = book.bookType
            span
                i(class="book-title") 时间：
                = book.updateTime
            span
                i(class="book-title") 来源：
                = book.remark
        div(class="book-add")= isInBook? '移出书架':'加入书架'
    div(class="sub-title") 作品描述
    div(class="book-description")!= book.description
    - let i = 0;
    - let length = catalog ? catalog.length : 0;
    if(length > 0)
        div(class="sub-title clearfix")
            a(href=`/book/catalog?bookId=${book.id}&isSort=2` class="fl") 最新章节
            a(href=`/book/catalog?bookId=${book.id}` class="fr") 全部章节
        ul(class="catalog-list")
            - for(i; i<length; i++)
                li
                    a(href=`/book/catalogInfo?bookId=${book.id}&catalogId=${catalog[i].id}&num=${catalog[i].num}`)= catalog[i].name
            li(class="tc")
                a(href=`/book/catalog?bookId=${book.id}`) 查看全部章节...
    - let ii = 0;
    - let length2 = otherBook ? otherBook.length : 0;
    if(length2 > 0)
        div(class="sub-title") 作者其他书
        div(class="other-book")
            - for(ii; ii<length2; ii++)
                a(href=`/book/info?bookId=${otherBook[ii].id}&toBack=1`)
                    div
                        img(src=`http://localhost:3000/images/${otherBook[ii].id}`)
                    span= otherBook[ii].name
block scripts
    script(type="text/javascript" src="/js/pages/book/info.js")
